Prizm Content Connect
How to Configure PHP Samples

Installation

  1. Install Prizm Content Connect for Linux and verify the service is working correctly. The installation will place the PHP samples in the following directory: /usr/share/prizm/Samples/php.
  2. Install Apache and PHP. Refer to the directions that are specific to your distribution.
  3. Add the following to the Apache configuration:
 
Copy Code
Alias /pccis_sample /usr/share/prizm/Samples/php
<Directory /usr/share/prizm/Samples/php>
AllowOverride All
</Directory>
  1. On the command line, first check that the configuration file validates:
Example
Copy Code
apache2ctl configtest
  1. Then restart the Apache service to read the configuration changes:
Example
Copy Code
apache2ctl restart
  1. Give read/write permissions to the Documents folder and the Markups folder. Give read permissions to the ImageStamp folder. These folders are installed to: /usr/share/prizm/Samples on Linux. For more information, see the "Configuration with pcc.config" section below.
  2. Test the sample application in a browser:

The following will route you directly to the HTML 5 viewer sample splash page: http://myservername:port/pccis_sample/splash

  1. From the splash page you have two options:

PHP Directory Structure

The php samples are installed under: /usr/share/prizm/Samples/php. This folder contains 3 sub-folders, one folder for each of the two samples (book-reader-sample and full-viewer-sample) and one folder for the splash page:

Each of the sample folders are completely self-contained, meaning that they contain all of the files needed to run the sample. Furthermore, with the exception of a few project files and build files, the sample folders contain only the files needed to run the sample.

Folder contents: full-viewer-sample

File / Folder

Description

viewer-assets folder

Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the viewer.

viewer-assets/less folder

Contains less that can be used to build the viewer CSS. This folder is non-essential, and does not need to be re-distributed.

viewer-assets/Gruntfile.js

Contains Grunt tasks to build the viewer less. This file is non-essential and does not need to be re-distributed.

viewer-assets/package.json

A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Grunt and compile the less.

viewer-webtier folder

Contains files that implement the php layer of communication between the client-side viewer and the PCC backend services.

viewer-webtier/pcc.php

Contains the supporting functions for the RESTful communication between the viewer and web server. The client side viewer Javascript object will use this RESTful interface as described in PCC RESTful API. The file is required for functionality in a PHP enabled web server environment. While the code for the functions can be modified as needed, modifications should be done with care. Most of the current web server RESTful interface passes the request onto Prizm Services.

viewer-webtier/pcc.config

Defines the configuration for the web tier. Configuration parameters include: Path to source documents, path to saved markup files, path to image stamp files, and connection settings for the PCC RESTful API.

viewer-webtier/imagingServiceProxy.php

This class provides a common set of methods for communicating with the PCC Imaging Service.

viewer-webtier/pccConfig.php

This class parses the pcc.config file and provides methods for easily reading its parameters.

viewer-webtier/utils.php

A class containing helpful methods used frequently throughout the application.

index.php

The default web starting page in this sample. The HTML5 viewer’s code gets loaded by this page.

.htaccess

Contains Apache web server settings.

predefinedSearch.json

This data file contains information defining search queries that will appear as selectable items in the full viewer.

Note: This file is consumed by the page Default.aspx and the JSON is injected into the HTML that is returned by Default.aspx. Ultimately, the predefined search terms are provided as a JavaScript hash, when the viewer is created.

redactionReason.json

This data file contains information defining redaction reasons that are available in the viewer.

Note: This file is consumed by the page Default.aspx and the JSON is injected into the HTML that is returned by Default.aspx. Ultimately, the redaction reasons are provided as a JavaScript hash, when the viewer is created.

Folder contents: book-reader-sample

File / Folder

Description

sample-assets folder

Contains assets consumed by the sample page (index.html), but not consumed by the book reader viewer.

viewer-assets folder

Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the book reader viewer.

viewer-assets/less folder

Contains less that can be used to build the viewer CSS. This folder is non-essential, and does not need to be re-distributed.

viewer-assets/Gruntfile.js

Contains Grunt tasks to build the viewer less. This file is non-essential and does not need to be re-distributed.

viewer-assets/package.json

A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Grunt and compile the less.

viewer-assets/selection.json

A file used by the IcoMoon application to generate the icons in the book reader viewer.  If you need to add an icon to the viewer, you can add the icon to this file and use the IcoMoon application (https://icomoon.io) to generate a new icon font. This file is non-essential and does not need to be re-distributed.

viewer-webtier folder

Contains files that implement the php layer of communication between the client-side book reader viewer and the PCC backend services.

viewer-webtier/createSession.php

This file is used by index.html to create a PCC Viewing Session with the PCC RESTful API.

viewer-webtier/pcc.php

Contains the supporting functions for the RESTful communication between the book reader viewer and web server. The client side viewer Javascript object will use this RESTful interface as described in PCC RESTful API. The file is required for functionality in a PHP enabled web server environment. While the code for the functions can be modified as needed, modifications should be done with care. Most of the current web server RESTful interface passes the request onto Prizm Services.

viewer-webtier/pcc.config

Defines the configuration for the web tier. Configuration parameters include: Path to source documents, path to saved markup files, path to image stamp files, and connection settings for the PCC RESTful API.

viewer-webtier/imagingServiceProxy.php

This class provides a common set of methods for communicating with the PCC Imaging Service.

viewer-webtier/pccConfig.php

This class parses the pcc.config file and provides methods for easily reading its parameters.

viewer-webtier/utils.php

A class containing helpful methods used frequently throughout the application.

index.html

The default page for the sample. This page calls the createSession.php service to start a viewing session with the PCC RESTful services and then the page loads the book reader.

sample-config.js

Contains references to the assets, web tier, and language files used by the viewer in this sample.

.htaccess

Contains Apache web server settings.

Configuration with pcc.config

The file pcc.config is used to configure the resources and storage used by the viewer web tier. This file can be found in each sample folder at: <sample-folder-name>/viewer-webtier/pcc.config. This file is self-documenting, but a little information about the configuration options is given below:

<DocumentPath>

The sample pulls named documents from this location. The DocumentPath must have read/write permissions in order for the file drag and drop functionality of the splash page to work.

<ImageStampPath>

The sample pulls image stamps from this location. Any valid image stamp in this folder will be available to the viewer for use as an image stamp. The ImageStampPath must have read permissions.

<ValidImageStampTypes>

A comma separated value list of file extensions. These extensions specify the valid image stamp file types. Only images in the ImageStampPath with a valid file type will be available for use as an image stamp in the viewer.

<MarkupsPath>

Saved markup XML is kept in this folder. The MarkupsPath will be written to by the web server process, so it must have read/write permissions.      

<WebService[Scheme|Host|Port|Path|V2Path]>

Specifies how to connect with the PCC RESTful API.

 

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback